<?php
class GuildCompetitionVo extends SzAbstractMySqlVo
{

    private $guildId;
    private $groupId;
    private $quality;
    private $point;
    private $flags;
    private $pointSpeed;
    private $step;
    private $drop;
    private $isRob;
    private $robIndex;
    private $delTask;
    private $participant;
    private $createTime;
    private $updateTime;
    private $endTime;

    /**
     * Initialize GuildCompetitionVo.
     *
     * @param $guildId
     * @param $groupId
     * @param $quality
     * @param $point
     * @param $flags
     * @param $pointSpeed
     * @param $step
     * @param $drop
     * @param $isRob
     * @param $robIndex
     * @param $delTask
     * @param $participant
     * @param $createTime
     * @param $updateTime
     * @param $endTime
     * @param boolean $isInsert default false, means for now this vo is initialized not for insert process
     * @return GuildCompetitionVo
     */
    public function __construct($guildId, $groupId, $quality, $point, $flags, $pointSpeed, $step, $drop, $isRob, $robIndex, $delTask, $participant, $createTime, $updateTime, $endTime, $isInsert = false) {
        $this->guildId = $guildId;
        $this->groupId = $groupId;
        $this->quality = $quality;
        $this->point = $point;
        $this->flags = $flags;
        $this->pointSpeed = $pointSpeed;
        $this->step = $step;
        $this->drop = $drop;
        $this->isRob = $isRob;
        $this->robIndex = $robIndex;
        $this->delTask = json_decode($delTask, true);
        $this->participant = $participant;
        $this->createTime = $createTime;
        $this->updateTime = $updateTime;
        $this->endTime = $endTime;

        $this->isInsert = $isInsert;
        $this->voClassName = 'GuildCompetitionVo';
        $this->ormName = 'GuildCompetition';
    }

    /**
     * @see SzAbstractVo::toArray
     */
    public function toArray($needEncode = false)
    {
        return array(
            'guildId' => $this->getGuildId(),
            'groupId' => $this->getGroupId(),
            'quality' => $this->getQuality(),
            'point' => $this->getPoint(),
            'flags' => $this->getFlags(),
            'pointSpeed' => $this->getPointSpeed(),
            'step' => $this->getStep(),
            'drop' => $this->getDrop(),
            'isRob' => $this->getIsRob(),
            'robIndex' => $this->getRobIndex(),
            'delTask' => ($needEncode) ? $this->getDelTask() : $this->getRawDelTask(),
            'participant' => $this->getParticipant(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
            'endTime' => $this->getEndTime(),
        );
    }

    /**
     * @see SzAbstractVo::toEntireArray
     */
    public function toEntireArray($needEncode = false)
    {
        return array(
            'guildId' => $this->getGuildId(),
            'groupId' => $this->getGroupId(),
            'quality' => $this->getQuality(),
            'point' => $this->getPoint(),
            'flags' => $this->getFlags(),
            'pointSpeed' => $this->getPointSpeed(),
            'step' => $this->getStep(),
            'drop' => $this->getDrop(),
            'isRob' => $this->getIsRob(),
            'robIndex' => $this->getRobIndex(),
            'delTask' => ($needEncode) ? $this->getDelTask() : $this->getRawDelTask(),
            'participant' => $this->getParticipant(),
            'createTime' => $this->getCreateTime(),
            'updateTime' => $this->getUpdateTime(),
            'endTime' => $this->getEndTime(),
        );
    }

    /**
     * @see SzAbstractVo::toPureArray
     */
    public function toPureArray()
    {
        return array(
            $this->getGuildId(),
            $this->getGroupId(),
            $this->getQuality(),
            $this->getPoint(),
            $this->getFlags(),
            $this->getPointSpeed(),
            $this->getStep(),
            $this->getDrop(),
            $this->getIsRob(),
            $this->getRobIndex(),
            $this->getDelTask(),
            $this->getParticipant(),
            $this->getCreateTime(),
            $this->getUpdateTime(),
            $this->getEndTime(),
        );
    }

    public function getGuildId()
    {
        return $this->guildId;
    }

    public function setGuildId($val)
    {
        $this->saveColumnStatus(0, $this->guildId);
        $this->guildId = $val;
    }

    public function getGroupId()
    {
        return $this->groupId;
    }

    public function setGroupId($val)
    {
        $this->saveColumnStatus(1, $this->groupId);
        $this->groupId = $val;
    }

    public function getQuality()
    {
        return $this->quality;
    }

    public function setQuality($val)
    {
        $this->saveColumnStatus(2, $this->quality);
        $this->quality = $val;
    }

    public function getPoint()
    {
        return $this->point;
    }

    public function setPoint($val)
    {
        $this->saveColumnStatus(3, $this->point);
        $this->point = $val;
    }

    public function getFlags()
    {
        return $this->flags;
    }

    public function setFlags($val)
    {
        $this->saveColumnStatus(4, $this->flags);
        $this->flags = $val;
    }

    public function getPointSpeed()
    {
        return $this->pointSpeed;
    }

    public function setPointSpeed($val)
    {
        $this->saveColumnStatus(5, $this->pointSpeed);
        $this->pointSpeed = $val;
    }

    public function getStep()
    {
        return $this->step;
    }

    public function setStep($val)
    {
        $this->saveColumnStatus(6, $this->step);
        $this->step = $val;
    }

    public function getDrop()
    {
        return $this->drop;
    }

    public function setDrop($val)
    {
        $this->saveColumnStatus(7, $this->drop);
        $this->drop = $val;
    }

    public function getIsRob()
    {
        return $this->isRob;
    }

    public function setIsRob($val)
    {
        $this->saveColumnStatus(8, $this->isRob);
        $this->isRob = $val;
    }

    public function getRobIndex()
    {
        return $this->robIndex;
    }

    public function setRobIndex($val)
    {
        $this->saveColumnStatus(9, $this->robIndex);
        $this->robIndex = $val;
    }

    public function getDelTask()
    {
        return json_encode($this->delTask);
    }

    public function getRawDelTask()
    {
        return $this->delTask;
    }

    public function setDelTask($val)
    {
        $encodedLength = SzUtility::strLen(json_encode($val));
        if ($encodedLength > 25600) {
            SzLogger::get()->error('[GuildCompetitionVo] The length of column delTask exceed the limit, length / limit: ' . $encodedLength . ' / 25600');
            throw new SzException(10522, array('GuildCompetitionVo', '25600', $encodedLength));
        } else if ($encodedLength > 23040) {
            SzLogger::get()->warn('[GuildCompetitionVo] The length of column delTask exceed the warning level, length / limit: ' . $encodedLength . ' / 25600');
        }
        $this->saveColumnStatus(10, $this->delTask);
        $this->delTask = $val;
    }

    public function getParticipant()
    {
        return $this->participant;
    }

    public function setParticipant($val)
    {
        $this->saveColumnStatus(11, $this->participant);
        $this->participant = $val;
    }

    public function getCreateTime()
    {
        return $this->createTime;
    }

    public function setCreateTime($val)
    {
        $this->saveColumnStatus(12, $this->createTime);
        $this->createTime = $val;
    }

    public function getUpdateTime()
    {
        return $this->updateTime;
    }

    public function setUpdateTime($val)
    {
        $this->saveColumnStatus(13, $this->updateTime);
        $this->updateTime = $val;
    }

    public function getEndTime()
    {
        return $this->endTime;
    }

    public function setEndTime($val)
    {
        $this->saveColumnStatus(14, $this->endTime);
        $this->endTime = $val;
    }

}